package com.oa.srms.apps.dao.student.impl;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.oa.srms.apps.dao.student.IAvatarInfoDao;
import com.oa.srms.apps.entity.student.AvatarInfoValue;

public class AvatarInfoDaoImpl extends HibernateDaoSupport implements
		IAvatarInfoDao {

	@Override
	public Integer addAvatarInfo(AvatarInfoValue avatarInfoValue)
			throws Exception {
		if (avatarInfoValue != null) {
			this.getHibernateTemplate().save(avatarInfoValue);
		}
		return avatarInfoValue.getAvatarId();
	}

	@Override
	public void editAvatarInfo(AvatarInfoValue avatarInfoValue)
			throws Exception {
		if (avatarInfoValue != null) {
			this.getHibernateTemplate().update(avatarInfoValue);
		}
	}

	@Override
	public AvatarInfoValue queryByAvatarId(Integer avatarId) throws Exception {
		return (AvatarInfoValue) this.getHibernateTemplate().get(AvatarInfoValue.class, avatarId);
	}

	@Override
	public List<AvatarInfoValue> queryAvatarInfo() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

}
